
class StrategyMan:
    def __init__(self, list=None):
        if list is None:
            self.strategies = []
        else:
            self.strategies = list

    def policy(self, stock, row):
        buy_percent = 0
        sell_percent = 0
        for s in self.strategies:
            score, act = s.policy(stock, row)
            if act == "buy":
                buy_percent = buy_percent + 1
            if act == "sell":
                sell_percent = sell_percent + 1
        if buy_percent/len(self.strategies) > 0.7:
            return 1, "buy"
        if sell_percent/len(self.strategies) > 0.7:
            return 1, "sell"
        return 0, ""
